#ifndef _DRV_TIMER_H
#define _DRV_TIMER_H

#include "sys_hc32f460.h"
#include <hc32f460_usart.h>

typedef void(*Timer_Excu_Func)(void *);

typedef struct{
	Timer_Excu_Func func;//周期执行函数
	uint32_t period_ms;//执行周期
	uint32_t cnt_ms;//当前计数
	uint8_t active_flag;//活动标志
	uint8_t excute_flag;//执行标志
}Timer_t;
void refresh_timing_task(void);
Timer_t *timer_create(Timer_Excu_Func func,uint32_t period);
void timer_start(Timer_t *timer);
void timer_stop(Timer_t *timer);
void timer_start_all(void);
void timer_stop_all(void);
void timer_reset(Timer_t *timer);
#endif
